module {
  func.func @clamp_non_negative(%x: i32) -> i32 {
    %c0 = arith.constant 0 : i32
    %cmp = arith.cmpi slt, %x, %c0 : i32
    %result = scf.if %cmp -> (i32) {
      scf.yield %c0 : i32
    } else {
      scf.yield %x : i32
    }
    return %result : i32
  }

  func.func @compute(%boost: i1, %value: i32) -> i32 {
    %base = func.call @clamp_non_negative(%value) : (i32) -> i32
    %c1 = arith.constant 1 : i32
    %double = arith.shli %base, %c1 : i32
    %result = arith.select %boost, %double, %base : i1, i32
    return %result : i32
  }
}
